<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>3939：[Usaco2015 Feb]Cow Hopscotch</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Usaco2015 Feb]Cow Hopscotch</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Usaco2015 Feb]Cow Hopscotch</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                [Usaco2015 Feb]Cow Hopscotch                </h1>
                <p>时间限制：10s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：128MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><p style="font-family: Raleway, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px;">Just like humans enjoy playing the game of Hopscotch, Farmer John's cows have invented a variant of the game for themselves to play. Being played by clumsy animals weighing nearly a ton, Cow Hopscotch almost always ends in disaster, but this has surprisingly not deterred the cows from attempting to play nearly every afternoon.</p>
<p style="font-family: Raleway, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px;">The game is played on an R by C grid (2 &lt;= R &lt;= 750, 2 &lt;= C &lt;= 750), where each square is labeled with an integer in the range 1..K (1 &lt;= K &lt;= R*C). Cows start in the top-left square and move to the bottom-right square by a sequence of jumps, where a jump is valid if and only if</p>
<p style="font-family: Raleway, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px;">1) You are jumping to a square labeled with a different integer than your current square,</p>
<p style="font-family: Raleway, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px;">2) The square that you are jumping to is at least one row below the current square that you are on, and</p>
<p style="font-family: Raleway, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px;">3) The square that you are jumping to is at least one column to the right of the current square that you are on.</p>
<p style="font-family: Raleway, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px;">Please help the cows compute the number of different possible sequences of valid jumps that will take them from the top-left square to the bottom-right square.</p>
<div>就像人类喜欢跳格子游戏一样，FJ的奶牛们发明了一种新的跳格子游戏。虽然这种接近一吨的笨拙的动物玩跳格子游戏几乎总是不愉快地结束，但是这并没有阻止奶牛们在每天下午参加跳格子游戏&nbsp;</div>
<div>游戏在一个R*C的网格上进行，每个格子有一个取值在1-k之间的整数标号，奶牛开始在左上角的格子，目的是通过若干次跳跃后到达右下角的格子，当且仅当格子A和格子B满足如下条件时能从格子A跳到格子B：&nbsp;</div>
<div>1.B格子在A格子的严格右方(B的列号严格大于A的列号)&nbsp;</div>
<div>2.B格子在A格子的严格下方(B的行号严格大于A的行号)&nbsp;</div>
<div>3.B格子的标号和A格子的标号不同&nbsp;</div>
<div>请你帮助奶牛计算出从左上角的格子到右下角的格子一共有多少种不同的方案</div>
<pre style="font-size: 14px;"></pre>
<p></p></p><hr/><h3>输入格式</h3><p><div><span style="font-family: Raleway, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px;">The first line contains the integers R, C, and K. The next R lines will each contain C integers, each in the range 1..K.</span></div>
<div>
<div>第一行包含两个整数R C K&nbsp;</div>
<div>接下来的R行，每行C个整数表示格子的标号</div>
</div>
<div>
<pre style="font-size: 14px;"></pre>
</div>
<p></p></p><hr/><h3>输出格式</h3><p><h4 style="font-family: Raleway, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px;">Output the number of different ways one can jump from the top-left square to the bottom-right square, mod 1000000007.</h4>
<div>一行，代表有多少种不同的方案，由于答案很大，请输出答案对1000000007取模的结果</div>
<div></div>
<pre style="font-size: 14px;"></pre>
<p></p></p><hr/><h3>样例输入</h3><pre>4 4 4
1 1 1 1
1 3 2 1
1 2 4 1
1 1 1 1</pre><hr/><h3>样例输出</h3><pre>5</pre><hr/><h3>提示</h3><p>没有写明提示</p><hr/><h3>题目来源</h3><p>Gold</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=3939" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=3939" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>